home *** CD-ROM | disk | FTP | other *** search
/ Windows 3-Pak 2 - Disc 2 / Infomagic - Windows 3-Pak Volume 2 (Disc 2 of 3).iso / Chat---IRC / TURBOIRC.ZIP / data1.cab / TurboIRC_Scripts / ETEXTFLOOD.txt < prev    next >
Text File  |  1999-05-05  |  2KB  |  61 lines

  1. // TEXT FLOOD TurboIRC Script
  2. // By Chourdakis Michael ,⌐ 1998
  3. // This script uses IntegerLists index 0 , 1 , 2
  4.  
  5. // This event can be loaded like 
  6. // /_event TEXTFLOOD 21 2 0 +* PRIVMSG #* :*|||+* PRIVMSG &* :*|||+* PRIVMSG %* :*|||?.\demos\textflood.txt
  7.  
  8. // Formula for TextFlood 
  9. // When a message is got , set the tick count in int[0]
  10. // If old tick count is too slow , increase int[1]
  11. // If int[1] comes to 3 , kick .
  12.  
  13. // Take Old User Tick Count
  14.  
  15. int OldZ = GetUserData($nick,0)
  16.  
  17. // Take current Tick Count
  18. int NewZ = GetTickCount()
  19.  
  20. if (OldZ == 0)
  21.  // No need to fire ... just add the timer
  22.  /setuserdata $nick 0 %NewZ%
  23.  return
  24. endif
  25.  
  26. // Here , it is not too last ...!
  27. int Diff = NewZ - OldZ
  28.  
  29. // Is difference too high ?
  30. if (Diff > 6000)
  31.  // yes , clear all 0 and 1 entries , flood control not exist
  32.  /setuserdata $nick 0 0
  33.  /setuserdata $nick 1 0
  34.  //setuserdata $nick 2 0
  35.  return
  36. endif
  37. // Now , it is too low ! Flood step 1 !!
  38. // Increase int[1] and If it is set to 3 , show first warning
  39. int OldF = GetUserData($nick,1)
  40. if (OldF < 2)
  41.  OldF += 1
  42.  /setuserdata $nick 1 %OldF%
  43.  return
  44. endif
  45.  
  46. // Here ? The flood steps are 3 ! , throw warning or KICK !
  47. int OldW = GetUserData($nick,2)
  48. if (OldW < 3)
  49.  OldW += 1
  50.  /setuserdata $nick 0 0
  51.  /setuserdata $nick 2 %OldW%
  52.  /display $channel $nick , 4Warning #%OldW%1 : Flood protection is ENABLED !!
  53.  return
  54. endif
  55.  
  56. // Here , KICK him
  57. /setuserdata $nick 0 0
  58. /setuserdata $nick 1 0
  59. /setuserdata $nick 2 0
  60. /kick $channel $nick  DirtY FloodER !!
  61.